# -*- coding: utf-8 -*-
from django.http import HttpResponse
from django.shortcuts import render
from django.views.decorators import csrf


# 接收POST请求数据
def search_post(request):
    ctx = {}
    if request.POST:
        ctx['rlt'] = request.POST['q']
    return render(request, "post.html", ctx)


def runoob2(request):
    print(request.POST)
    name = request.POST.get("q")
    return render(request, "post2.html", {'rlt': f'姓名：{name}'})